package es.usc.citius.openet.mg.tab.fragments;

import android.os.Bundle;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import es.usc.citius.openet.mg.tab.R;
import es.usc.citius.openet.mg.tab.events.Event;
import es.usc.citius.openet.mg.tab.events.EventBus;
import es.usc.citius.openet.mg.tab.events.EventFactory;

public class FakeEventsFragment extends Fragment implements
		View.OnClickListener {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		View view = inflater.inflate(R.layout.fake_events_fragment, null);

		view.findViewById(R.id.task_selected).setOnClickListener(this);
		view.findViewById(R.id.fakeB_2).setOnClickListener(this);
		view.findViewById(R.id.fakeB_3).setOnClickListener(this);

		return view;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.task_selected: {
			//Simulamos un evento do tipo TASK_SELECTED
			//String tsk1 = "TID3ZKTkVCB7QXxTpt4bN9jZ3SMy8X8Yst8";
			//String tsk1 = "TIDRkdz966JvYs5dM7JgLjxcgsEo7vapBDS";
			String tsk1 ="TIDEZXshxMpdPGKLYb4f1OuawU42SQvOufj";
			Message event = EventFactory.createEvent(Event.EVENT_TASK_SELECTED, tsk1);
			EventBus.getInstance().sendEvent(event);
		}
			break;

		case R.id.fakeB_2: {
			Message event = EventFactory
					.createEvent(Event.EVENT_PATIENT_SELECTED, "");
			EventBus.getInstance().sendEvent(event);
		}
			break;
			
		case R.id.fakeB_3: {
			Message event = EventFactory
					.createEvent(Event.EVENT_MG_SELECTED, "");
			EventBus.getInstance().sendEvent(event);
		}
			break;

		default:
			break;
		}

	}

}
